https://retellai.com/?utm_source=discord&utm_medium=seo logo
Not transitioning between states
# ❓・bug-report
b
I am creating a multi-prompt agent but for some reason it asks a question and only stays in the 'warm_intro' state. I need it to go through everything to ask all the propper qualification questions and do multiple tasks.
n
Can you share the section of prompt where you have written when and how to transition?
b
Here is the part of the state that allows it to transition: ### Warm_Intro ## Purpose: Engage the client with a warm introduction and set the context for gathering information about their situation. This ensures the client feels comfortable and informed about the next steps. ## Task: 1. Greet the client and ask them how you can help them. 2. Acknowledge their response, express concern, and explain that you'll gather some key details to assist them. ## Transition: - **If the client mentions a workplace injury**: Transition to WC_Injury_Details. - **If the client mentions insurance details**: Transition to Insurance_adjuster. - **If discussing a claim adjuster**: Transition to Claim_adjuster. - **If it is potentially for personal injury**: Transition to Personal_injury. - **If discussing switching law firms**: Transition to Switching_firms. Now here is the edge that is similar throughout all states: Transition to personal_injury if the client confirms the injury outside of work.
s
This is the intro prompt for my dental reception agent, which works: #Task: 1. Use the 'current_time' function to get the current time (do not say that out loud, this is just for your reference). 2. Introduce yourself, stating that you are Kate from Sanava Dental. 3. If they haven't told the purpose of the call yet, ask how you can help. 4. Ask their name (only if they haven't told you earlier). 5. Ask, if they visited the clinic before. - If they visited the clinic before, transition to existing_patient. - If they did not visit the clinic before, transition to new_patient. Can you try this style of prompting?
@bpmma
Oh hold on discord changes the formatting of the prompt. Let me take a screenshot
b
@sanava.ai It still seems to be stuck in the same state.
s
Which llm are you using?
b
GPT 4o
On the Retell Multi State
s
And you also described the if conditions in all edges?
Maybe it is having a hard time deciding which state to go to because you have 5
How about putting personal and workplace injury as one (only "injury")
?
And splitting up in the next step?
b
I even removed a step, removed some transitions, and adjusted to edge but for some reason as you can see it is still in that warm intro phase.
s
Ooh ok i think it doesnt get when to switch to task 2
So you could make it more clearer in task 1 when to make the decision
After the first message?
b
@sanava.ai Do you think I should add some keywords to where if the person says x transition to this state etc.?
s
Yes definetly give some more examples!
Like, I slipped at a liquor store means personal injury and so on.
Also define some rules
Its asking stuff which you havent prompted it to ask.. like "when did it happen". You probably want this to be asked later.. not in the intro
b
@sanava.ai That is in the third prompt which is why it is confusing. To me it seems like it is grouping all the prompts together to establish some sort of knowledge base and then it doesn't know what to do so at the end instead of qualifying them it just tries to book a call.
I added to the general prompt when I ask a prompting question to answer it and it even knows it is supposed to move on
s
Can you try this: 1. Greet the client and ask how you can help them. 2. After the caller's initial response, decide whether the caller is talking about - a personal injury - a workplace injury - (Your other categories...) (Do not say this step out loud.) 3. Transition based on .. (the rest as is in your current step 2)
Ok discord messed up the formatting again
Number 3. 4. and 5 are supposed to be bullet points
In my opinion it is not stuck in the intro state, it is stuck in the first step of the intro state, because it doesnt know when to go to the next step
Your prompt needs to be broken down in smaller steps so you have more control
b
Could this be a problem with the state or could this fall back to the general prompt as a whole?
s
I usually dont have much info in the general prompt (besides some identity info) because i think it could lead to confusion
Could this be the problem in your case?
How does your general prompt look like
b
I have a somewhat long prompt however I did just have it successfully transition two times but on the third time it just failed.
I have never had issues with the general prompts being very long only on the states not transitioning right.
s
What did you differently now to get the two transitions?
b
I took out some fluff in the warm intro prompt but after checking the log it looks like it went to the next stage then ended.
n
Thanks @sanava.ai for helping out here and iterating on the prompt. Few pointers I would add: 1. Keep the general prompt short if you are using multi states and write the style guidelines and general identity info here 2. For each state also keep the prompts concise as possible. Multiple transitions from one state to 4-5 states can make it confusing sometimes for the LLM to follow. It becomes crucial to write conditions more explicitly. 3. Here is an example prompt I had for an intro state "## Task: 1. Whenever a comes to this state with a query, first detect the intent of the customer query and classify it into one of the following scenarios: - Customer Service Query: If the customer wants to know more about their previous orders like order status or want to cancel an order or replace/return items or is having issues related to payment, then transition to customer_service - Product Recommendation Query: If the customer is looking to buy a new product and needs suggestions or help in deciding the right product then transition to get_product_recommendations - FAQ Query: If the customer wants to know general information about the store or wants to know more about policies like return, refund, shipping, etc., then transition to get_general_info 2. When there are no more questions, proceed to the next step. 3. After all steps are completed, use end_call to hang up."